<?php

/*

  Action	$4

  +1 Card
  +2 Actions
  You may trash this card immediately. If you do, +$2.

 */

class MiningVillage extends Card implements iAction, iKingdom, iIntrigue {

    public function __construct() {
        parent::__construct("Mining Village", 4);
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "+1 Card",
            "+2 Actions",
            "You may trash this card immediately. If you do, +$2.");
    }

    public function play(Game $game, $isRealCard) {
        $game->addActions(2);
        $drawed_cards = $game->drawCards(1);
        ScreenDisplay::addScreenMessage($game, true, "get +2 actions and draw " . nicePrint($drawed_cards, "gets +2 actions and draws " . sizeof($drawed_cards) . " cards"));

        if ($isRealCard == REAL_CARD) {
            $options = array(new Option(1, "Yes"), new Option(2, "No"));
            $output = MySocket::GetUserReply($game, Input_ChooseOne, $options, 1, 1, null, "Trash Mining Village for 2$ ?");
            $answer = $output[0];
            if ($answer == "Yes") {
                $game->moveCardFromPileToPile($this, PlayArea, Trash);
                $game->addMoney(new Price(2));
                ScreenDisplay::addScreenMessage($game, true, "trash ".  nicePrint($this)." and get +2$", "trashes a ".ScreenDisplay::$LMSG." and gets +2$");
            }
        }
        $game->cardActionFinished();
        return true;
    }

}

?>